package eu.robico.simulator.simulatorinterface.actionpanel;

import eu.robico.simulator.simulatorinterface.utils.Toolkit;

public class Line
{
	private final Position startPosition, endPosition;
	
	public Line(Position startPosition, Position endPosition)
	{
		this.startPosition = startPosition;
		this.endPosition = endPosition;
	}

	public Position getStartPosition() 
	{
		return startPosition;
	}

	public Position getEndPosition() 
	{
		return endPosition;
	}
	
	public boolean intersectsWith(Line line)
	{
		return Toolkit.intersect(startPosition, endPosition,
				line.getStartPosition(), line.getEndPosition());
	}
}